Image processing method and apparatus, electronic device, and storage medium

ABSTRACT

Provided are an image processing method and apparatus, an electronic device, and a storage medium. The method includes: identifying a first object to be rendered in a target image and a second object to which the first object belongs in the target image; generating a reference image including a mark based on the target image and the second object, the mark being used for recording a coverage area of the second object; determining an area to be rendered based on the reference image and the first object, the area to be rendered being located within the coverage area corresponding to the mark; and rendering the area by utilizing a target material to generate a rendering result. Through the process, the rendering range can be constrained when the first object is rendered based on the reference image including the mark generated by the second object to which the first object belongs, so that the reliability and authenticity of a rendering result are improved.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a continuation of International Patent ApplicationNo. PCT/CN2020/080924, filed on Mar. 24, 2020, which claims priority toChinese Patent Application No. 201911154806.5, filed to the NationalIntellectual Property Administration, PRC on Nov. 22, 2019 and entitled“Image Processing Method and Apparatus, Electronic Device and StorageMedium”. The disclosures of International Patent Application No.PCT/CN2020/080924 and Chinese Patent Application No. 201911154806.5 arehereby incorporated by reference in their entireties.

TECHNICAL FIELD

The present disclosure relates to the technical field of imageprocessing, and more particularly, to an image processing method andapparatus, an electronic device, and a storage medium.

BACKGROUND

Image rendering is a process of converting a three-dimensional lightenergy transfer process into a two-dimensional image. Scenes andentities are represented in three dimensions, closer to the real worldand easier to be manipulated and transformed. However, in a process ofrendering a target object, a rendering overflow phenomenon alwaysoccurs.

SUMMARY

According to a first aspect of the present disclosure, a method forimage processing is provided, which may include the followingoperations.

A first object to be rendered in a target image and a second object towhich the first object belongs in the target image are identified.

A reference image including a mark is generated based on the targetimage and the second object, the mark being used for recording acoverage area of the second object.

An area to be rendered is determined based on the reference image andthe first object, the area to be rendered being located within thecoverage area corresponding to the mark.

The area to be rendered is rendered by utilizing a target material togenerate a rendering result.

According to an aspect of the present disclosure, an apparatus for imageprocessing is provided, which may include an identification module, areference image generation module, a to-be-rendered area determinationmodule and a rendering module.

The identification module is configured to identify a first object to berendered in a target image and a second object to which the first objectbelongs in the target image.

The reference image generation module is configured to generate areference image including a mark based on the target image and thesecond object, the mark being used for recording a coverage area of thesecond object.

The to-be-rendered area determination module is configured to determinean area to be rendered based on the reference image and the firstobject, the area to be rendered being located within the coverage areacorresponding to the mark.

The rendering module is configured to render the area by utilizing atarget material to generate a rendering result.

According to an aspect of the present disclosure, an electronic deviceis provided. The electronic device may include:

a processor; and

a memory configured to store instructions executable by the processor.

The processor may be configured to implement the above image processingmethod.

According to an aspect of the present disclosure, a computer-readablestorage medium is provided, which may store computer programinstructions thereon. The computer program instructions are executed bya processor to implement the above method for image processing.

According to an aspect of the present disclosure, computer-readablecodes are provided. When the computer-readable codes run in anelectronic device, a processor in the electronic device may execute themethod for image processing.

It is to be understood that the above general descriptions and detaileddescriptions below are only exemplary and explanatory and not intendednon limit the present disclosure. According to the following detaileddescriptions on the exemplary embodiments with reference to theaccompanying drawings, other characteristics and aspects of the presentdisclosure become apparent.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of this specification, illustrate embodiments consistent with thepresent disclosure and, together with the description, serve to explainthe principles of the present disclosure.

FIG. 1 illustrates a flowchart of an image processing method accordingto an embodiment of the present disclosure.

FIG. 2 illustrates a schematic diagram of a target image according to anembodiment of the present disclosure.

FIG. 3 illustrates a schematic diagram of a target material according toan embodiment of the present disclosure.

FIG. 4 illustrates a schematic diagram of a first feature point setaccording to an embodiment of the present disclosure.

FIG. 5 illustrates a schematic diagram of a second feature point setaccording to an embodiment of the present disclosure.

FIG. 6 illustrates a schematic diagram of a second object according toan embodiment of the present disclosure.

FIG. 7 illustrates a schematic diagram of a reference image according toan embodiment of the present disclosure.

FIG. 8 illustrates a schematic diagram of a rendering result accordingto an embodiment of the present disclosure.

FIG. 9 illustrates a schematic diagram of a fusion result according toan embodiment of the present disclosure.

FIG. 10 illustrates a block diagram of an image processing apparatusaccording to an embodiment of the present disclosure.

FIG. 11 illustrates a block diagram of an electronic device according toan embodiment of the present disclosure.

FIG. 12 illustrates a block diagram of an electronic device according toan embodiment of the present disclosure.

DETAILED DESCRIPTION

Various exemplary embodiments, features and aspects of the presentdisclosure will be described below in detail with reference to theaccompanying drawings. A same numeral in the accompanying drawingsindicates a same or similar component. Although various aspects of theembodiments are illustrated in the accompanying drawings, theaccompanying drawings are unnecessarily drawn in proportion unlessotherwise specified.

As used herein, the word “exemplary” means “serving as an example,embodiment, or illustration”. Thus, any embodiment described herein as“exemplary” is not to be construed as preferred or advantageous overother embodiments.

The term “and/or” in this specification is only for describing anassociation relationship between associated objects, which representsthree relationships may exist. For example, A and/or B may represent thefollowing three cases: only A exists, both A and B exist, and only Bexists. In addition, the term “at least one type” herein represents anyone of multiple types or any combination of at least two types in themultiple types, for example, at least one type of A, B and C mayrepresent any one or multiple elements selected from a set formed by theA, the B and the C.

In addition, for describing the disclosure better, many specific detailsare presented in the following specific implementations. It is to beunderstood by those skilled in the art that the present disclosure stillcan be implemented even without some specific details. In some examples,methods, means, components and circuits known very well to those skilledin the art are not described in detail, to highlight the subject of thepresent disclosure.

FIG. 1 illustrates a flowchart of an image processing method accordingto an embodiment of the present disclosure. The method may be applied toan image processing apparatus which may be a terminal device, a serveror other processing device, etc. The terminal device may be UserEquipment (UE), a mobile device, a user terminal, a terminal, a cellphone, a cordless phone, a Personal Digital Assistant (PDA), a handhelddevice, a computing device, a vehicle-mounted device, a wearable device,etc.

In some possible implementations, the image processing method may beimplemented by enabling a processor to call computer-readableinstructions stored in a memory.

As shown in FIG. 1, the image processing method may include thefollowing operations.

In S11, a first object to be rendered in a target image and a secondobject to which the first object belongs in the target image areidentified.

In S12, a reference image including a mark is generated based on thetarget image and the second object, the mark being used for recording acoverage area of the second object.

In S13, an area to be rendered is determined based on the referenceimage and the first object, the area to be rendered being located withinthe coverage area corresponding to the mark.

In S14, the area to be rendered is rendered by utilizing a targetmaterial to generate a rendering result.

According to the image processing method provided by the embodiments ofthe present disclosure, the first object to be rendered and the secondobject to which the first object belongs in the target image may beidentified, the reference image including the mark may be generatedbased on the target image and the second object, and the area to berendered which is located in the coverage area corresponding to the markmay be determined based on the reference image and the first object, sothat the area to be rendered may be rendered by utilizing a targetmaterial, and the rendering result may be generated. Through theprocess, the rendering range can be constrained when the first object isrendered based on the reference image including the mark generated bythe second object to which the first object belongs, so that thereliability and authenticity of a rendering result are improved.

In the embodiment above, the target image is not limited to any types.Any image requiring rendering can be taken as the target image. In apossible implementation, the target image may be an object with a facearea, such as a portrait image, a half-body image, or a whole-bodyimage.

FIG. 2 illustrates a schematic diagram of a target image according to anembodiment of the present disclosure. As shown in the figure, the targetimage may be a portrait image containing a face in the embodiments ofthe present disclosure. In addition, the specific content of the firstobject to be rendered in the target image may also be confirmed based onactual rendering requirements, and no limitation is made in theembodiments of the present disclosure.

In a possible implementation, when the target image is an objectincluding a face area, the first object may be a portion of the face,such as a pupil, a nose bridge, an ear lobe, or a lip, which may bedetermined based on actual requirements. The specific content of thesecond object to which the first object belongs may be flexiblydetermined based on the actual situation of the first object. Forexample, when the first object is a pupil, the second object may be aneye; when the first object is a nose bridge, the second object may be anose; when the first object is an ear lobe, the second object may be anear; and when the first object is a lip, the second object may be amouth. In addition, the number of target images is not limited. In apossible implementation, a target image may include a single picture ormultiple pictures, i.e., objects in multiple pictures can be rendered inbulk at a time.

Since the target image, the first object and the second object can allbe flexibly determined based on the actual situation, the referenceimage generated based on the target image and the second object, themarks included in the reference image and the area to be rendereddetermined based on the reference image and the first object can all beflexibly changed based on different situations of the target image andthe like. Explanation is not provided here for a while, and the detailswill be described in the following embodiments.

As can be seen from S14 of the above-mentioned embodiment, the renderingresult can be obtained by rendering the area to be rendered based on thetarget material, and the target material can also be flexibly set basedon the actual situation of the first object, and is not limited to thefollowing embodiments. For example, when the first object is a pupil,the target material may be a pupil beautifying material; when the firstobject is a nose bridge, the target material may be a shadow material;when the first object is an ear lobe, the target material may be an earring material; and when the first object is a lip, the target materialmay be a lipstick material.

In a possible implementation, the first object may include a pupilobject, the second object may include an eye object, the target materialmay include a material for beautifying the pupil. In an example, thematerial for beautifying the pupil may be a pupil beautifying material.The specific content of the pupil material may be flexibly selected andset, and the acquisition mode may be flexibly determined based on actualconditions. In an example, the pupil beautifying material may berandomly selected from a pupil beautifying material library. In anexample, the pupil beautifying material may be a specific materialselected based on requirements, etc. FIG. 3 illustrates a schematicdiagram of a target material according to an embodiment of the presentdisclosure. As can be seen from the figure, in the example, the targetmaterial may be a purple pupil beautifying material having a glossytexture (purple color is not visible due to the constraints on drawingof figures).

Based on the first object including a pupil object, the second objectincluding an eye object and the pupil beautifying material including thepupil beautifying material, the image processing method provided by theembodiments of the present disclosure can be applied to a process ofbeautifying the pupil in a face image, so that the rendering range iseffectively restricted by a reference image with a mark generated basedon the eye object, and the possibility of rendering the pupilbeautifying material to an area outside the pupil in the renderingprocess is reduced.

It should be noted that the image processing method of the embodimentsof the present disclosure is not limited to processing of an imageincluding a face area, and may be applied to any image processing. Thepresent disclosure is not limited thereto.

The manner in which the target image is acquired is not limited, and isnot limited by the embodiments below. In a possible implementation, thetarget image may be obtained by reading or receiving. In a possibleimplementation, the target image may be obtained by active capture orother active acquisition.

Based on the target image obtained by the above embodiment, the firstobject and the second object in the target image may be identified byS11. The manner for implementing S11 is not limited. In a possibleimplementation, the first object and the second object to be rendered inthe target image may be determined by performing detection in the targetimage. In an example, detection for the first object and detection forthe second object may be performed in the target image, respectively. Inan example, detection for the second object may also be carried out inthe target image, and then the target image may be clipped based on adetection result with regard to the second object to retain an image ofthe second object. Since the first object belongs to a part of thesecond object, detection may be further carried out in the clipped imageto obtain an area corresponding to the first object.

The manner of detection is also not limited in the embodiments of thepresent disclosure. Any manner in which the target object may be failedor detected from an image can be used as an implementation of detection.In a possible implementation, detection may be achieved by featureextraction.

Therefore, in a possible implementation, S11 may include the followingoperations.

In S111, Features are extracted from the target image to respectivelyobtain a first feature point set corresponding to the first object and asecond feature point set corresponding to the second object.

In S112, first feature points included in the first feature point setare connected in a first preset manner to obtain an area correspondingto the first object.

In S113, second feature points included in the second feature point setare connected in a second preset manner to obtain an area correspondingto the second object.

The first feature point set and the second feature point set may beobtained by extracting features from the target image, feature points inthe first feature point set may be connected in the first preset mannerto obtain the area corresponding to the first object, and feature pointsin the second feature point set may be connected in the second presetmanner to obtain the area corresponding to a second object. The areacorresponding to the first object may also be called a coverage area ofthe first object. The area corresponding to the second object may alsobe called a coverage area of the second object.

Through the process, the positions of the first object and the secondobject in the target image can be quickly located on the basis of thefirst feature point set and the second feature point set in an effectivefeature extraction mode, so that the area corresponding to the firstobject and the area corresponding to the second object to which thefirst object belongs may be obtained, the rendering process of the firstobject can be conveniently restrained by the position of the secondobject, and the reliability of the rendering result is improved.

In the above embodiment, the implementation manner of S111 is notlimited. That is, the specific manner of feature extraction is notlimited in the embodiment, and any calculation method capable ofperforming feature extraction may be used as the implementation mannerof S111.

As mentioned in the above embodiment, a sequence according to which thedetection is performed on the first object and the second object may beflexibly selected based on the actual situation. Since featureextraction is a possible implementation manner of detection, the featureextraction may be performed on the first object and the second object atthe same time, or the feature extraction may be performed on the secondobject first and then on the first object. The feature extractionmanners for the first object and the second object may be the same ordifferent, and will not be repeated herein. Based on the above reasons,there may be or may not be a common feature point between the firstfeature point set and the second feature point set. No matter whetherthere is a common feature point or not, there is no impact on thesubsequent process of obtaining the area corresponding to the firstobject and the area corresponding to the second object. Therefore, arelationship between the two feature point sets is not limited in theembodiments of the present disclosure. FIG. 4 illustrates a schematicdiagram of a first feature point set according to an embodiment of thepresent disclosure. FIG. 5 illustrates a schematic diagram of a secondfeature point set according to an embodiment of the present disclosure.As shown in the figures, in an example, the first feature point set inFIG. 4 is a set of feature points resulting from pupil feature pointextraction of a face image in FIG. 2. The second feature point set inFIG. 5 is a set of feature points obtained from extracting eye featurepoints from the face image in FIG. 2. As can be seen from the figures,the first feature point set and the second feature point set in theexamples of the present disclosure are both obtained by extractingfeatures from the target image, and the first feature point set and thesecond feature point set have coincident feature points at the junctionof the pupil and the eye.

After obtaining the first feature point set and the second feature pointset, the area corresponding to the first object and the areacorresponding to the second object may be obtained through S112 andS113. In the embodiments of the present disclosure, the executionsequence of S112 and S113 is not restricted. S112 and S113 may beexecuted simultaneously or sequentially. When executed sequentially,S112 or S113 may be executed first, which is not limited herein.

As can be seen from S112, the process of obtaining the first object maybe connecting feature points in the first feature point set in a firstpreset mode. A specific implementation of the first preset mode is notlimited in the embodiments of the present disclosure, which may bedetermined based on the actual situation of the first object withoutlimitation. Similarly, a second preset mode of obtaining the areacorresponding to the second object may be flexibly selected based onactual conditions, and the second preset mode may be the same as ordifferent from the first preset mode.

In a possible implementation, S112 may include the following operation.

First feature points included in the first feature point set areconnected to obtain at least one first mesh according to the sequence ina first preset mode, and an area covered by the first mesh is taken asthe area corresponding to the first object.

It can be seen from the above embodiments that when the areacorresponding to the first object is obtained, the first feature pointscontained in the first feature point set may be connected in the firstpreset mode. It has been proposed in the above embodiments that thefirst preset mode may be set based on actual conditions, and thereforethe connection order of the first feature points is also determined in apreset mode. After the first feature points are connected in a presetorder, at least one mesh may be obtained, and the mesh may be referredto as a first mesh in the embodiments of the present disclosure. Theamount and shape of the first meshes may be determined based on thenumber of the first feature points contained in the first feature pointset and the situation of the first preset mode. In an example, the firstpreset mode may be: classifying each three first feature points in thefirst feature point set into a group for connection to form multipletriangular meshes. Particularly, there is no limits to which threepoints are classified into a group, which may be set based on actualconditions. In an example, the first preset mode may also be:classifying each four first feature points in the first feature pointset into a group for connection to form multiple quadrangular meshes.Similarly, no limit is set to the classification mode.

Based on the example of the above preset mode, it can be seen that in apossible implementation, S112 may include the following operations.

In S1121, the first feature point set is divided by taking at leastthree first feature points as a group to obtain at least one subset offirst feature points.

In S1122, the first feature points included in the at least one subsetof first feature points are sequentially connected to obtain at leastone first mesh.

In S1123, an area covered by the at least one first mesh is taken as thearea corresponding to the first object.

The number of first feature points as a group may be three, or may bemore than three such as four, five or six, without limitation herein.Through the process, the area where the first object is located can becompletely covered effectively based on the actual situation of thefirst feature point set, excessive computing resources are not needed,the first object can be quickly and efficiently determined, andpreparation can be made for a subsequent rendering process.

Similarly, in a possible implementation, S113 may include the followingoperations.

Second feature points included in the second feature point set areconnected into at least one second mesh according to the sequence of asecond preset mode, and an area covered by the second mesh is taken asthe area corresponding to the second object.

The specific implementation process of the above embodiment may refer tothe implementation process of the first object. In a possibleimplementation, S113 may include the following operations.

In S1131, the second feature point set is divided by taking at leastthree second feature points as a group to obtain at least one subset ofsecond feature points.

In S1132, the second feature points included in the at least one subsetof second feature points are sequentially connected to obtain at leastone second mesh.

In S1133, an area covered by the at least one second mesh is taken asthe area corresponding to the second object.

FIG. 6 illustrates a schematic diagram of a second object according toan embodiment of the present disclosure. As can be seen from the figure,in an example, by connecting the second feature points in the secondfeature point set in FIG. 5 in the second preset mode, multipletriangular meshes may be obtained, which together form the areacorresponding to the second object.

The above first and second meshes, as polygon meshes, are sets ofvertices and polygons representing polyhedral shapes inthree-dimensional computer graphics, also called unstructured meshes.Exemplarily, the first mesh and the second mesh may be triangularmeshes. The area corresponding to the first object and the areacorresponding to the second object are enclosed by the triangular meshso as to facilitate subsequent rendering.

After determining the first object and the second object, a referenceimage including a mark for recording a coverage area of the secondobject may be generated from the target image and the second objectthrough S12. The implementation manner of S12 may be flexibly determinedbased on the actual conditions of the first object and the secondobject, and is not limited to the embodiments described below. In apossible implementation, S12 may include the following operations.

In S121, a first initial image with a same size as the target image isgenerated.

In S122, the coverage area of the second object is marked in the firstinitial image to obtain the reference image.

By generating the first initial image with the same size as the targetimage and marking the coverage area of the second object in the firstinitial image to obtain the reference image, the position of the secondobject in the target image can be effectively marked by utilizing areconstructed image with the same size as the target image, so thatwhether the rendered pixels exceed the position constraint of the secondobject or not when the first object is rendered can be determined on thebasis of the marks in a subsequent rendering process, the possibility ofrendering overflow is reduced, and the reliability and authenticity ofrendering are improved.

In the above embodiment, the size of the first initial image is the sameas that of the target image, and the specific image content thereof isnot limited in the embodiments of the present disclosure. In an example,the first initial image may be a blank image. In an example, the firstinitial image may be an image covered with a certain texture. Thecovered texture is not limited in the embodiments of the presentdisclosure and can be flexibly set based on practical situations. Thetexture is one or multiple two-dimensional graphics representing detailsof the surface of an object, and may also be referred to as texturemapping. In an example, the first initial image may be an image coveredby a solid color texture, the color of which may be flexibly set toblack, white, red, etc. The generation process of the first initialimage is not limited in the embodiments of the present disclosure. Animage of the same size may be created after the size of the target imageis obtained.

After the first initial image is generated, the coverage area of thesecond object may be marked in the first initial image to obtain thereference image through S122. Since the first initial image has the samesize as the target image, the position of the marked area in the firstinitial image coincides with the position of the second object in thetarget image. The manner of marking is not limited in the embodiments ofthe present disclosure. Any marking manner that can distinguish the areacorresponding to the second object from the remaining areas of the firstinitial object in the first initial image may be implemented as amarking manner In a possible implementation, the marking may be addingmarkers to the first initial image at locations where marking isdesired. The markers may be symbols, data, textures, etc., withoutlimitation herein.

In a possible implementation, the marking may be implemented byadjusting pixel values in an image. In this implementation, S122 mayinclude the following operation.

At least one pixel included in the coverage area of the second object ischanged into a target pixel value in the first initial image to obtainthe reference image.

An image area having a target pixel value is an image area including amark in the reference image. Further, in addition to marking the targetpixel values for the coverage area of the second object for the firstinitial image, other areas than the coverage area of the second objectmay be adjusted to other pixel values that are different from the targetpixel values to achieve significant differentiation of the two differentareas.

By changing at least one pixel included in the coverage area of thesecond object into the target pixel value in the first initial image toobtain the reference image, marking of the coverage area of the secondobject can be realized in a simple manner of changing a color of thecoverage area of the second object. The process is simple, and the costis saved.

In a possible implementation, S122 may also include the followingoperation.

The coverage area of the second object is rendered through a presettexture in the first initial image to obtain the reference image.

In the above embodiment, a preset texture is rendered to the areacorresponding to the second object, the specific implementation thereofis not limited in the embodiments of the present disclosure. The areacorresponding to the second object may be distinguished from other areasof the first initial image. In an example, when the first initial imageis a blank image, the preset texture may be any texture that does notinclude a blank area. In an example, when the first initial image isoverlaid by a solid color texture of a certain color, the preset texturemay be any texture that does not contain the color. FIG. 7 illustrates aschematic diagram of a reference image according to an embodiment of thepresent disclosure. As can be seen from the figure, in the example ofthe present disclosure, the first initial image is an image covered by ablack texture, while the second object is rendered by a red texture,thereby generating the reference image as shown in the figure.

The reference image is obtained by rendering the coverage area of thesecond object through a preset texture in the first initial image. Theposition of the second object can be marked in the reference image in asimpler manner, and sufficient preparation is made for subsequentrendering of the area to be rendered based on the mark. Meanwhile, thesecond object is applied to the whole rendering process through therendering mark. The whole image processing process can be completedthrough the same rendering means, extra resource consumption is reduced,the overall image processing efficiency is improved, and the cost issaved.

After obtaining the reference image, the area to be rendered may bedetermined through S13. In a possible implementation, S13 may includethe following operations.

In S131, a second initial image with a same size as the target image isgenerated.

In S132, the area to be rendered is determined in the second initialimage based on the reference image and the first object.

In the embodiment, the area to be rendered in the second initial imagewith the same size as the target image is determined based on thereference image and the first object. Through the above process, sincethe reference image is generated based on the position of the secondobject in the target image, the area to be rendered can be constrainedby the position of the second object, thereby reducing the possibilitythat rendering overflows the required rendering range. The reliabilityof the rendering result is improved.

In particular, how to determine the area to be rendered based on thereference image and the first object can be flexibly determined based onactual conditions of the mark in the reference image. In a possibleimplementation, S132 may include the following operations.

In S1321, an area corresponding to the first object is taken as aninitial area to be rendered in the second initial image.

In S1322, pixels of the initial area to be rendered are traversed, andwhen corresponding positions of the pixels in the reference imageinclude the mark, the pixels are taken as pixels to be rendered.

In S1323, an area formed by the pixels to be rendered is taken as thearea to be rendered.

In S1321, the generation process and implementation manner of the secondinitial image are not limited here. Reference may be made to thegeneration process and implementation manner of the first initial imageproposed in the above embodiment, which will not be described in detailherein. It is noted that the implementation manner of the second initialimage may be the same as or different from that of the first initialimage.

After the second initial image is generated, the pixels of the initialarea to be rendered may be traversed through S1322. When each pixel istraversed, the reference image may be searched for a pixel with the sameposition as the pixel traversed. The pixel traversed may be recorded asa traversed pixel in the embodiments of the present disclosure, and thecorresponding pixel in the reference image may be recorded as areference pixel. Then, whether the reference pixel is marked or not maybe judged. It can be known from the above embodiment that the markedarea in the reference image is the position of the second object in thetarget image. Therefore, if the reference pixel is marked, it indicatesthe traversal pixel in the area to be rendered is in the range of thesecond object, and in this case, the traversed pixel may be taken as apixel to be rendered subsequently by the target material. If thereference pixel is not marked, it indicates that the traversed pixel inthe area to be rendered exceeds the range of the second object, and inthis case, if the traversed pixel is rendered, the rendering may exceeda preset range. Therefore the reference pixel cannot serve as a pixel tobe rendered.

After pixels in an initial area to be rendered are traversed, all thepixels to be rendered may be obtained, and the pixels to be rendered mayjointly form the area to be rendered.

After the area to be rendered is obtained, the area to be rendered maybe rendered using a target material through S14, so that a renderingresult is obtained. The specific manner of rendering is not limited inthe embodiments of the present disclosure, and any applicable renderingmethod may be implemented in the embodiments of the present disclosure.In an example, rendering may be implemented in a shader through OpenGL.The specific implementation of rendering through a preset texture in thefirst initial image proposed in the above embodiment may also beimplemented in the same manner FIG. 8 illustrates a schematic diagram ofa rendering result according to an embodiment of the present disclosure.As can be seen from the figure, the second initial image is an imagecovered by a black texture, and is rendered by the pupil beautifyingmaterial as shown in FIG. 3, thereby obtaining a rendering result asshown in the figure.

The area corresponding to the first object is taken as the initial areato be rendered in the second initial image, and pixels in the initialarea to be rendered are traversed. When a pixel corresponding to atraversed pixel in the reference image is marked, the traversed pixel istaken as a pixels to be rendered, and the area formed by such pixels tobe rendered is taken as the area to be rendered. The area to be renderedby the target material can be effectively cut, the possibility that thearea exceeds the constraint range of the second object to which thefirst object belongs is reduced, and the reliability and authenticity ofthe rendering result are improved.

After the rendering result is obtained, the rendering result may becombined with the original target image, so that the target image can befurther modified or perfected. The specific combination manner may bedetermined based on the actual situation and requirements of the targetimage and the target material. For example, when the target image is animage including a face area and the target material is a pupilbeautifying material, the combination may be a combination of therendering result and the target image, etc. Therefore, in a possibleimplementation, the method provided in the embodiments of the presentdisclosure may further include the following operations.

In S15, transparency of the target image is changed to obtain a changeresult.

In S16, the rendering result is fused with the change result to obtain afused image.

In the above embodiment, the specific value for changing thetransparency of the target image is not limited here, which may beflexibly set based on the actual situation. The fusion effect of therendering result and the target image can be guaranteed. Because thesize of the second initial image generating the rendering result is thesame as that of the target image, the rendering result can beeffectively fused to a corresponding position in the target image. Forexample, when the target image is a face image and the target materialis a pupil, the position to which the pupil material is rendered in thefusion result is consistent with the position of the pupil in the faceimage. Therefore, when the rendering result and the target image withthe changed transparency are fused, the rendered pupil beautifyingmaterial is naturally fused to the position of the pupil in the faceimage, so that the pupil beautifying effect of the face image isachieved. FIG. 9 illustrates a schematic diagram of a fusion resultaccording to an embodiment of the present disclosure. As can be seenfrom the figure that the pupil beautifying material of FIG. 3 may beefficiently and accurately fused to the pupil position of the face imageof FIG. 2 by the image processing method proposed in each of the aboveembodiments.

Application Scenario Example

Make-up of a face image is one of the main methods in face imageprocessing, such as pupil-beautifying, adding lipstick to the lip of theface image or adding shadow to the nose bridge. Taking pupil beautifyingas an example, when a pupil beautifying material is rendered on the faceimage, the pupil beautifying material is most likely to be rendered onthe eyelid or outside the eyelid in the pupil beautifying processbecause the opening and closing degree of eyes in the face image may bedifferent, so that a pupil beautifying result is inaccurate, andrealness of the pupil beautifying result is degraded.

Therefore, an image processing process based on a reliable renderingmode can greatly improve the quality of pupil beautifying, so that thequality and the application range of the image processing method can beimproved and expanded.

As shown in FIGS. 2-9, the embodiments of the disclosure provide animage processing method. The specific process of the processing methodmay be as follows:

FIG. 2 is a face image to be pupil-beautified (i.e. the target imagementioned in the various embodiments of the disclosure). In an exampleof the present disclosure, a pupil contour point (shown in FIG. 4) ofthe face image may be extracted as a second feature point set of asecond object and an eye contour point (shown in FIG. 5) may beextracted as a first feature point set of a first object through featurepoint extraction. After eye contour points are obtained, the eye contourpoints may be connected to obtain an eye triangular mesh as a first meshaccording to a preset sequence (as shown in FIG. 6), and similarly, thepupil contour points may be connected to obtain another pupil triangularmesh as a second mesh according to a preset sequence.

After the eye triangular mesh shown in FIG. 6 is obtained, a blacktexture map with the same size as that of FIG. 2 may be created as afirst initial image, then the black texture map and the vertexcoordinates of the eye triangular mesh in FIG. 6 may be transmitted intoa shader, pixels at positions corresponding to the eye triangular meshin the black texture map may be rendered into red through OpenGL toserve as marks, and pixels at other positions may still keep an originalstate, so that the mask texture of the eye contour is thus obtained,i.e. the reference image including markers (as shown in FIG. 7).

After the mask texture of the eye contour is obtained, the mask textureof the eye contour, the vertex coordinates of the pupil triangular meshobtained before, and the pupil beautifying material shown in FIG. 3 maybe transmitted into a shader together, so that the pupil beautifyingmaterial may be rendered. In the application example of the presentdisclosure, the rendering process of the pupil beautifying material maybe: firstly, generating a black texture image as a second initial image,determining a position of the pupil based on the vertex coordinates ofthe pupil triangular mesh, sequentially traversing each pixel at thepupil position, and every time a pixel is traversed, judging whether acolor of a pixel corresponding to the pixel in the mask texture of theeye outline is red or not: if yes, indicating that the pixel is in therange of the eye and is a pixel to be rendered, and then rendering thepupil beautifying material on the pixel; otherwise, if not, indicatingthat the pixel is out of the range of eyes, and not rendering the pupilbeautifying material on the pixel. After each pixel at the pupilposition is traversed, a rendering result can be obtained. The renderingresult may be regarded as a clipped pupil beautifying material, and theposition of the pupil beautifying material is consistent with theposition of the pupil in the face image. The rendering result is shownin FIG. 8.

After the rendering result is obtained, the rendering result and theoriginal face image may be subjected to transparency fusion. Since theposition of the rendering result is consistent with the position of thepupil in the face image, the pupil may be accurately fused into thepupil of the face image after fusion, so that the pupil of the face canbe beautified. The fused result is shown in FIG. 9. It can be seen fromthe figure that a reliable pupil beautifying result can be obtainedthrough the above process, and the fused pupil beautifying does notexceed the range of the pupil, and is not rendered to the periocularposition.

According to the image processing method provided by the embodiments ofthe present disclosure, a first object to be rendered and a secondobject to which the first object belongs in a target image may beidentified, a reference image including a mark is generated based on thetarget image and the second object, and an area to be rendered which islocated in a coverage area corresponding to the mark may be determinedbased on the reference image and the first object, so that the area tobe rendered can be rendered by utilizing a target material, and arendering result can be generated. Through the process, the renderingrange can be constrained when the first object is rendered based on thereference image including the mark generated by the second object towhich the first object belongs, so that the reliability and authenticityof a rendering result are improved.

It should be noted that the image processing method of the embodimentsof the present disclosure is not limited to the above image processingincluding the face area, nor is it limited to the above process of pupilbeautifying of the face image. The method may be applied to arbitraryimage processing, which is not limited by the present disclosure.

It is to be understood that the method embodiments mentioned in thepresent disclosure may be combined with each other to form a combinedembodiment without departing from the principle and logic, which is notelaborated in the embodiments of the present disclosure for the sake ofsimplicity.

It may be understood by the person skilled in the art that in the methodof the specific implementations, the sequence of each operation does notmean a strict execution sequence or form any limit to the implementationprocess. The specific execution sequence of each operation may bedetermined in terms of the function and possible internal logic.

FIG. 10 illustrates a block diagram of an image processing apparatusaccording to an embodiment of the present disclosure. The imageprocessing apparatus may be a terminal device, a server or otherprocessing device, etc. The terminal device may be a UE, a mobiledevice, a user terminal, a terminal, a cell phone, a cordless phone, aPDA, a handheld device, a computing device, a vehicle-mounted device, awearable device, etc.

In some possible implementations, the image processing apparatus may beimplemented by enabling a processor to call computer-readableinstructions stored in a memory.

As shown in FIG. 10, the image processing apparatus 20 may include anidentification module 21, a reference image generation module 22, ato-be-rendered area determination module 23, and a rendering module 24.

The identification module 21 is configured to identify a first object tobe rendered in a target image and a second object to which the firstobject belongs in the target image.

The reference image generation module 22 is configured to generate areference image including a mark based on the target image and thesecond object, the mark being used for recording a coverage area of thesecond object.

The to-be-rendered area determination module 23 is configured todetermine an area to be rendered based on the reference image and thefirst object, the area to be rendered being located within the coveragearea corresponding to the mark.

The rendering module 24 is configured to render the area by utilizing atarget material to generate a rendering result.

In a possible implementation, the reference image generation module isconfigured to: generate a first initial image with a same size as thetarget image; and mark the coverage area of the second object in thefirst initial image to obtain the reference image.

In a possible implementation, the reference image generation module isfurther configured to: change at least one pixel included in thecoverage area of the second object into a target pixel value in thefirst initial image to obtain the reference image.

In a possible implementation, the to-be-rendered area determinationmodule is configured to: generate a second initial image with a samesize as the target image; and determine the area to be rendered in thesecond initial image based on the reference image and the first object.

In a possible implementation, the to-be-rendered area determinationmodule is further configured to: take an area corresponding to the firstobject as an initial area to be rendered in the second initial image;traverse pixels of the initial area to be rendered, and when positionsin the reference image, corresponding to traversed pixels, include themark, take the traversed pixels as pixels to be rendered; and take anarea formed by the pixels to be rendered as the area to be rendered.

In a possible implementation, the identification module is configuredto: extract features from the target image to respectively obtain afirst feature point set corresponding to the first object and a secondfeature point set corresponding to the second object; connect firstfeature points included in the first feature point set in a first presetmanner to obtain an area corresponding to the first object; and connectsecond feature points included in the second feature point set in asecond preset manner to obtain an area corresponding to the secondobject.

In a possible implementation, the identification module is furtherconfigured to: divide the first feature point set by taking at leastthree first feature points as a group to obtain at least one subset offirst feature points; sequentially connect the first feature pointsincluded in the at least one subset of first feature points to obtain atleast one first mesh; and take an area covered by the at least one firstmesh as the area corresponding to the first object.

In a possible implementation, the identification module is furtherconfigured to: divide the second feature point set by taking at leastthree second feature points as a group to obtain at least one subset ofsecond feature points; sequentially connect the second feature pointsincluded in the at least one subset of second feature points to obtainat least one second mesh; and take an area covered by the at least onesecond mesh as the area corresponding to the second object.

In a possible implementation, the apparatus may further include a fusionmodule, configured to: change transparency of the target image to obtaina change result; and fuse the rendering result with the change result toobtain a fused image.

In a possible implementation, the first object may include a pupil, thesecond object may include an eye, and the target material may include amaterial for beautifying the pupil.

An embodiment of the present disclosure further provides acomputer-readable storage medium, which stores computer programinstructions thereon. The computer program instructions are executed bya processor to implement the above method. The computer-readable storagemedium may be a non-volatile computer-readable storage medium.

An embodiment of the present disclosure further provides an electronicdevice, which includes: a processor; and a memory configured to storeinstructions executable by the processor, the processor being configuredto execute the above method.

The electronic device may be provided as a terminal, a server or othertypes of devices.

FIG. 11 is a block diagram of an electronic device 800 according to anembodiment of the present disclosure. For example, the electronic device800 may be a terminal such as a mobile phone, a computer, a digitalbroadcast terminal, a messaging device, a gaming console, a tablet, amedical device, exercise equipment, and a PDA.

Referring to FIG. 11, the electronic device 800 may include one or moreof the following components: a processing component 802, a memory 804, apower component 806, a multimedia component 808, an audio component 810,an Input/Output (I/O) of interface 812, a sensor component 814, and acommunication component 816.

The processing component 802 typically controls overall operations ofthe electronic device 800, such as the operations associated withdisplay, telephone calls, data communications, camera operations, andrecording operations. The processing component 802 may include one ormore processors 820 to execute instructions to perform all or part ofthe operations in the above described methods. Moreover, the processingcomponent 802 may include one or more modules which facilitate theinteraction between the processing component 802 and other components.For example, the processing component 802 may include a multimediamodule to facilitate the interaction between the multimedia component808 and the processing component 802.

The memory 804 is configured to store various types of data to supportthe operation of the electronic device 800. Examples of such datainclude instructions for any applications or methods operated on theelectronic device 800, contact data, phonebook data, messages, pictures,video, etc. The memory 804 may be implemented by using any type ofvolatile or non-volatile memory devices, or a combination thereof, suchas a Static Random Access Memory (SRAM), an Electrically ErasableProgrammable Read-Only Memory (EEPROM), an Erasable ProgrammableRead-Only Memory (EPROM), a Programmable Read-Only Memory (PROM), aRead-Only Memory (ROM), a magnetic memory, a flash memory, a magnetic oroptical disk.

The power component 806 provides power to various components of theelectronic device 800. The power component 806 may include a powermanagement system, one or more power sources, and any other componentsassociated with the generation, management and distribution of power inthe electronic device 800.

The multimedia component 808 includes a screen providing an outputinterface between the electronic device 800 and the user. In someembodiments, the screen may include a Liquid Crystal Display (LCD) and aTouch Panel (TP). If the screen includes the TP, the screen may beimplemented as a touch screen to receive input signals from the user.The TP includes one or more touch sensors to sense touches, swipes andgestures on the TP. The touch sensors may not only sense a boundary of atouch or swipe action, but also sense a period of time and a pressureassociated with the touch or swipe action. In some embodiments, themultimedia component 808 includes a front camera and/or a rear camera.The front camera and/or the rear camera may receive an externalmultimedia datum while the electronic device 800 is in an operationmode, such as a photographing mode or a video mode. Each of the frontcamera and the rear camera may be a fixed optical lens system or havefocus and optical zoom capability.

The audio component 810 is configured to output and/or input audiosignals. For example, the audio component 810 includes a Microphone(MIC) configured to receive an external audio signal when the electronicdevice 800 is in an operation mode, such as a call mode, a recordingmode, and a voice recognition mode. The received audio signal may befurther stored in the memory 804 or transmitted via the communicationcomponent 816. In some embodiments, the audio component 810 furtherincludes a speaker to output audio signals.

The I/O interface 812 provides an interface between the processingcomponent 802 and peripheral interface modules, such as a keyboard, aclick wheel, or buttons. The buttons may include, but are not limitedto, a home button, a volume button, a starting button, and a lockingbutton.

The sensor component 814 includes one or more sensors to provide statusassessments of various aspects of the electronic device 800. Forexample, the sensor component 814 may detect an open/closed status ofthe electronic device 800, and relative positioning of components. Forexample, the component is the display and the keypad of the electronicdevice 800. The sensor component 814 may also detect a change inposition of the electronic device 800 or a component of the electronicdevice 800, a presence or absence of user contact with the electronicdevice 800, an orientation or an acceleration/deceleration of theelectronic device 800, and a change in temperature of the electronicdevice 800. The sensor component 814 may include a proximity sensorconfigured to detect the presence of nearby objects without any physicalcontact. The sensor component 814 may also include a light sensor, suchas a Complementary Metal Oxide Semiconductor (CMOS) or Charge CoupledDevice (CCD) image sensor, for use in imaging applications. In someembodiments, the sensor component 814 may also include an accelerationsensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or atemperature sensor.

The communication component 816 is configured to facilitatecommunication, wired or wirelessly, between the electronic device 800and other devices. The electronic device 800 may access a wirelessnetwork based on a communication standard, such as WiFi, 2G or 3G, or acombination thereof. In one exemplary embodiment, the communicationcomponent 816 receives a broadcast signal or broadcast associatedinformation from an external broadcast management system via a broadcastchannel In one exemplary embodiment, the communication component 816further includes a Near Field Communication (NFC) module to facilitateshort-range communications. For example, the NFC module may beimplemented based on a Radio Frequency Identification (RFID) technology,an Infrared Data Association (IrDA) technology, an Ultra-Wideband (UWB)technology, a Bluetooth (BT) technology, and other technologies.

In exemplary embodiments, the electronic device 800 may be implementedwith one or more Application Specific Integrated Circuits (ASICs),Digital Signal Processors (DSPs), Digital Signal Processing Devices(DSPDs), Programmable Logic Devices (PLDs), Field Programmable GateArrays (FPGAs), controllers, micro-controllers, microprocessors, orother electronic elements, for performing the above described methods.

In an exemplary embodiment, a non-volatile computer-readable storagemedium, for example, a memory 804 including computer programinstructions, is also provided. The computer program instructions may beexecuted by a processor 820 of an electronic device 800 to implement theabove-mentioned method.

FIG. 12 is a block diagram of an electronic device 1900 according to anembodiment of the present disclosure. For example, the electronic device1900 may be provided as a server. Referring to FIG. 12, the electronicdevice 1900 includes a processing component 1922, further including oneor more processors, and a memory resource represented by a memory 1932,configured to store instructions executable by the processing component1922, for example, an application program. The application programstored in the memory 1932 may include one or more modules, with eachmodule corresponding to one group of instructions. In addition, theprocessing component 1922 is configured to execute the instruction toexecute the above-mentioned method.

The electronic device 1900 may further include a power component 1926configured to execute power management of the electronic device 1900, awired or wireless network interface 1950 configured to connect theelectronic device 1900 to a network and an I/O interface 1958. Theelectronic device 1900 may be operated based on an operating systemstored in the memory 1932, for example, Windows Server™, Mac OS XTM,Unix™, Linux™, FreeBSD™ or the like.

In an exemplary embodiment, a non-volatile computer-readable storagemedium, for example, a memory 1932 including computer programinstructions, is also provided. The computer program instructions may beexecuted by a processing component 1922 of an electronic device 1900 toimplement the above-mentioned method.

The present disclosure may include a system, a method and/or a computerprogram product. The computer program product may include acomputer-readable storage medium, in which computer-readable programinstructions configured to enable a processor to implement each aspectof the present disclosure is stored.

The computer-readable storage medium may be a physical device capable ofretaining and storing instructions executable by an instructionexecution device. The computer-readable storage medium may be, but notlimited to, an electric storage device, a magnetic storage device, anoptical storage device, an electromagnetic storage device, asemiconductor storage device or any appropriate combination thereof.More specific examples (non-exhaustive list) of the computer-readablestorage medium include a portable computer disk, a hard disk, a RandomAccess Memory (RAM), a ROM, an EPROM (or a flash memory), an SRAM, aCompact Disc Read-Only Memory (CD-ROM), a Digital Video Disk (DVD), amemory stick, a floppy disk, a mechanical coding device, a punched cardor in-slot raised structure with an instruction stored therein, and anyappropriate combination thereof. Herein, the computer-readable storagemedium is not explained as a transient signal, for example, a radio waveor another freely propagated electromagnetic wave, an electromagneticwave propagated through a wave guide or another transmission medium (forexample, a light pulse propagated through an optical fiber cable) or anelectric signal transmitted through an electric wire.

The computer-readable program instruction described here may bedownloaded from the computer-readable storage medium to eachcomputing/processing device or downloaded to an external computer or anexternal storage device through a network such as an Internet, a LocalArea Network (LAN), a Wide Area Network (WAN) and/or a wireless network.The network may include a copper transmission cable, an optical fibertransmission cable, a wireless transmission cable, a router, a firewall,a switch, a gateway computer and/or an edge server. A network adaptercard or network interface in each computing/processing device receivesthe computer-readable program instruction from the network and forwardsthe computer-readable program instruction for storage in thecomputer-readable storage medium in each computing/processing device.

The computer program instruction configured to execute the operations ofthe present disclosure may be an assembly instruction, an InstructionSet Architecture (ISA) instruction, a machine instruction, a machinerelated instruction, a microcode, a firmware instruction, state settingdata or a source code or target code edited by one or any combination ofmore programming languages, the programming language including anobject-oriented programming language such as Smalltalk and C++ and aconventional procedural programming language such as “C” language or asimilar programming language. The computer-readable program instructionmay be completely or partially executed in a computer of a user,executed as an independent software package, executed partially in thecomputer of the user and partially in a remote computer, or executedcompletely in the remote server or a server. In a case involved in theremote computer, the remote computer may be connected to the usercomputer via an type of network including the LAN or the WAN, or may beconnected to an external computer (such as using an Internet serviceprovider to provide the Internet connection). In some embodiments, anelectronic circuit, such as a programmable logic circuit, a FieldProgrammable Gate Array (FPGA) or a Programmable Logic Array (PLA), iscustomized by using state information of the computer-readable programinstruction. The electronic circuit may execute the computer-readableprogram instruction to implement each aspect of the present disclosure.

Herein, each aspect of the present disclosure is described withreference to flowcharts and/or block diagrams of the method, device(system) and computer program product according to the embodiments ofthe present disclosure. It is to be understood that each block in theflowcharts and/or the block diagrams and a combination of each block inthe flowcharts and/or the block diagrams may be implemented bycomputer-readable program instructions.

These computer-readable program instructions may be provided for auniversal computer, a dedicated computer or a processor of anotherprogrammable data processing device, thereby generating a machine tofurther generate a device that realizes a function/action specified inone or more blocks in the flowcharts and/or the block diagrams when theinstructions are executed through the computer or the processor of theother programmable data processing device. These computer-readableprogram instructions may also be stored in a computer-readable storagemedium, and through these instructions, the computer, the programmabledata processing device and/or another device may work in a specificmanner, so that the computer-readable medium including the instructionsincludes a product including instructions for implementing each aspectof the function/action specified in one or more blocks in the flowchartsand/or the block diagrams.

These computer-readable program instructions may further be loaded to acomputer, other programmable data processing devices or other devices,so that a series of operations can be executed in the computer, theother programmable data processing devices or the other devices togenerate a process implemented by the computer to further realize thefunction/action specified in one or more blocks in the flowcharts and/orthe block diagrams by the instructions executed in the computer, theother programmable data processing device or the other device.

The flowcharts and block diagrams in the drawings illustrate probablyimplemented system architectures, functions and operations of thesystem, method and computer program product according to multipleembodiments of the present disclosure. On this aspect, each block in theflowcharts or the block diagrams may represent part of a module, aprogram segment or an instruction, and part of the module, the programsegment or the instruction includes one or more executable instructionsconfigured to realize a specified logical function. In some alternativeimplementations, the functions marked in the blocks may also be realizedin a sequence different from those marked in the drawings. For example,two continuous blocks may actually be executed in a substantiallyconcurrent manner and may also be executed in a reverse sequencesometimes, which is determined by the involved functions. It is furtherto be noted that each block in the block diagrams and/or the flowchartsand a combination of the blocks in the block diagrams and/or theflowcharts may be implemented by a dedicated hardware-based systemconfigured to execute a specified function or operation or may beimplemented by a combination of a special hardware and a computerinstruction.

Each embodiment of the present disclosure has been described above. Theabove descriptions are exemplary, non-exhaustive and also not limited toeach embodiment. Many modifications and variations are apparent to thoseof ordinary skill in the art without departing from the scope and spiritof each described embodiment of the present disclosure. The terms usedherein are selected to explain the principle and practical applicationof each embodiment or technical improvements in the technologies in themarket best or enable others of ordinary skill in the art to understandeach embodiment herein.

1. A method for image processing, comprising: identifying a first objectto be rendered in a target image and a second object to which the firstobject belongs in the target image; generating a reference imagecomprising a mark based on the target image and the second object, themark being used for recording a coverage area of the second object;determining an area to be rendered based on the reference image and thefirst object, the area to be rendered being located within the coveragearea corresponding to the mark; and rendering the area by utilizing atarget material to generate a rendering result.
 2. The method accordingto claim 1, wherein generating the reference image comprising the markbased on the target image and the second object comprises: generating afirst initial image with a same size as the target image; and markingthe coverage area of the second object in the first initial image toobtain the reference image.
 3. The method according to claim 2, whereinmarking the coverage area of the second object in the first initialimage to obtain the reference image comprises: changing, in the firstinitial image, at least one pixel comprised in the coverage area of thesecond object into a target pixel value to obtain the reference image.4. The method according to claim 1, wherein determining the area to berendered based on the reference image and the first object comprises:generating a second initial image with a same size as the target image;and determining the area to be rendered in the second initial imagebased on the reference image and the first object.
 5. The methodaccording to claim 4, wherein determining the area to be rendered in thesecond initial image based on the reference image and the first objectcomprises: taking, in the second initial image, an area corresponding tothe first object as an initial area to be rendered; traversing pixels ofthe initial area to be rendered, and when corresponding positions of thepixels in the reference image comprise the mark, taking the pixels aspixels to be rendered; and taking an area formed by the pixels to berendered as the area to be rendered.
 6. The method according to claim 1,wherein identifying the first object to be rendered in the target imageand the second object to which the first object belongs in the targetimage comprises: extracting features from the target image torespectively obtain a first feature point set corresponding to the firstobject and a second feature point set corresponding to the secondobject; connecting first feature points comprised in the first featurepoint set in a first preset manner to obtain an area corresponding tothe first object; and connecting second feature points comprised in thesecond feature point set in a second preset manner to obtain an areacorresponding to the second object.
 7. The method according to claim 6,wherein connecting the first feature points comprised in the firstfeature point set in the first preset manner to obtain the areacorresponding to the first object comprises: dividing the first featurepoint set by taking at least three first feature points as a group toobtain at least one subset of first feature points; sequentiallyconnecting the first feature points comprised in the at least one subsetof first feature points to obtain at least one first mesh; and taking anarea covered by the at least one first mesh as the area corresponding tothe first object.
 8. The method according to claim 6, wherein connectingthe second feature points comprised in the second feature point set inthe second preset manner to obtain the area corresponding to the secondobject comprises: dividing the second feature point set by taking atleast three second feature points as a group to obtain at least onesubset of second feature points; sequentially connecting the secondfeature points comprised in the at least one subset of second featurepoints to obtain at least one second mesh; and taking an area covered bythe at least one second mesh as the area corresponding to the secondobject.
 9. The method according to claim 1, further comprising: changingtransparency of the target image to obtain a change result; and fusingthe rendering result with the change result to obtain a fused image. 10.The method according to claim 1, wherein the first object comprises apupil, the second object comprises an eye, and the target materialcomprises a material for beautifying the pupil.
 11. An apparatus forimage processing, comprising: a processor; and a memory configured tostore instructions executable by the processor; wherein the processor isconfigured to: identify a first object to be rendered in a target imageand a second object to which the first object belongs in the targetimage; generate a reference image comprising a mark based on the targetimage and the second object, the mark being used for recording acoverage area of the second object; determine an area to be renderedbased on the reference image and the first object, the area to berendered being located within the coverage area corresponding to themark; and render the area by utilizing a target material to generate arendering result.
 12. The apparatus according to claim 11, wherein theprocessor is configured to: generate a first initial image with a samesize as the target image; and mark the coverage area of the secondobject in the first initial image to obtain the reference image.
 13. Theapparatus according to claim 12, wherein the processor is furtherconfigured to: change, in the first initial image, at least one pixelcomprised in the coverage area of the second object into a target pixelvalue to obtain the reference image.
 14. The apparatus according toclaim 11, wherein the processor is configured to: generate a secondinitial image with a same size as the target image; and determine thearea to be rendered in the second initial image based on the referenceimage and the first object.
 15. The apparatus according to claim 14,wherein the processor is further configured to: take, in the secondinitial image, an area corresponding to the first object as an initialarea to be rendered; traverse pixels of the initial area to be rendered,and when corresponding positions of the pixels in the reference imagecomprise the mark, take the pixels as pixels to be rendered; and take anarea formed by the pixels to be rendered as the area to be rendered. 16.The apparatus according to claim 11, wherein the processor is configuredto: extract features from the target image to respectively obtain afirst feature point set corresponding to the first object and a secondfeature point set corresponding to the second object; connect firstfeature points comprised in the first feature point set in a firstpreset manner to obtain an area corresponding to the first object; andconnect second feature points comprised in the second feature point setin a second preset manner to obtain an area corresponding to the secondobject.
 17. The apparatus according to claim 11, wherein the firstobject comprises a pupil, the second object comprises an eye, and thetarget material comprises a material for beautifying the pupil.
 18. Acomputer-readable storage medium, storing computer program instructionsthereon that, when executed by a processor, implement operationscomprising: identifying a first object to be rendered in a target imageand a second object to which the first object belongs in the targetimage; generating a reference image comprising a mark based on thetarget image and the second object, the mark being used for recording acoverage area of the second object; determining an area to be renderedbased on the reference image and the first object, the area to berendered being located within the coverage area corresponding to themark; and rendering the area by utilizing a target material to generatea rendering result.
 19. A computer program, comprising computer-readablecodes, wherein when the computer-readable codes run in an electronicdevice, a processor in the electronic device executes the method ofclaim 1.